package com.zhijian.medical.entity.vo.response;

import com.zhijian.medical.enums.EmailSendStatusEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * 发送邮件 回显vo
 *
 * @author auto
 * @version 1.0
 * @date 2023-12-27 20:31:03
 */
@Getter
@Api(tags = "发送邮件回显vo")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EmailSendVo implements Serializable {

    private static final long serialVersionUID = -1;

    /**
     * 主键ID
     */
    @ApiModelProperty("主键ID")
    private Long id;

    /**
     * 标题
     */
    @ApiModelProperty("标题")
    private String title;

    /**
     * 内容
     */
    @ApiModelProperty("内容")
    private String content;

    /**
     * 接收人员类型串，以英文逗号隔开
     */
    @ApiModelProperty("接收人员类型串，以英文逗号隔开")
    private String userTypes;

    /**
     * 接收人员类型枚举数组
     */
    @ApiModelProperty("接收人员类型枚举数组")
    private List<Long> userTypeList;

    /**
     * 接收人员类型串
     */
    @ApiModelProperty("接收人员类型串")
    private String userTypeNames;

    /**
     * 状态，0：未发送，1：已发送
     */
    @ApiModelProperty("状态，0：未发送，1：已发送")
    private Byte status;

    /**
     * 状态字符串
     */
    @ApiModelProperty("状态字符串")
    private String statusStr;

    /**
     * 发送时间
     */
    @ApiModelProperty("发送时间")
    private String sendTime;

    /**
     * 创建人ID
     */
    @ApiModelProperty("创建人ID")
    private Long createUserId;

    /**
     * 创建人姓名
     */
    @ApiModelProperty("创建人姓名")
    private String createUserName;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    private String createTime;

    public void setUserTypeList(List<Long> userTypeList) {
        this.userTypeList = userTypeList;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setUserTypes(String userTypes) {
        this.userTypes = userTypes;
    }

    public void setUserTypeNames(String userTypeNames) {
        this.userTypeNames = userTypeNames;
    }

    public void setStatus(Byte status) {
        this.status = status;
        if (Objects.isNull(status)) {
            this.statusStr = null;
            return;
        }
        EmailSendStatusEnum anEnum = EmailSendStatusEnum.getByCode(status.intValue());
        this.statusStr = Objects.nonNull(anEnum) ? anEnum.getDesc() : null;
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }

    public void setSendTime(String sendTime) {
        this.sendTime = sendTime;
    }

    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
}